<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:0px;border:0px">
		<t:datagrid pageSize="100" name="getexportList" checkbox="false" pagination="true" fitColumns="false" title="纪检查询" sortName="createDate" actionUrl="businessOrderController.do?topcheckDatagrid&startdt=${startdt}&enddt=${enddt}" idField="id" fit="true" queryMode="group">
			<t:dgCol title="频道"  frozenColumn="true"  field="sysOrgCode"   queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="栏目"  frozenColumn="true"  field="sysCompanyCode"   queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="姓名"  frozenColumn="true" field="userName" queryMode="single"  width="100"></t:dgCol>
			<t:dgCol title="身份证号"  frozenColumn="true" field="userCard" queryMode="single" width="126"></t:dgCol>
			<t:dgCol title="金额"  frozenColumn="true" field="ucost" queryMode="group" width="70"></t:dgCol>
			<t:dgCol title="汇款地址/账号"  field="costAddr" queryMode="single" width="120"></t:dgCol>
			<t:dgCol title="发放方式" field="costPutout" queryMode="single" width="70"></t:dgCol>
			<t:dgCol title="稿件题目(内容)" field="contribution" queryMode="single" width="120"></t:dgCol>
			<t:dgCol title="播出时间" field="columnTime" queryMode="single" width="80"></t:dgCol>
			<t:dgCol title="字数/时长/版面" field="columnNum" queryMode="single" width="100"></t:dgCol>
			<t:dgCol title="审核记录" field="uLog" queryMode="single" width="230"></t:dgCol>
		</t:datagrid>
		<div id="getexportListtb" style="padding: 3px; height: 50px">
			<div align="right" class="searchColums">
				<label for="sysOrgCode" class="col-sm-2 control-label">频道: </label>
				<select name="sysOrgCode" id="sysOrgCode" class="form-control" onchange="changeOrgCode(this.value)" value="${sysOrgCode}"></select>
				<label for="sysCompanyCode" class="col-sm-2 control-label">栏目： </label>
				<select name="sysCompanyCode" id="sysCompanyCode" class="form-control" value="${sysCompanyCode}"></select>
				<%--<label for="costType" class="col-sm-2 control-label">费用类型： </label>
				<select  name="costType" id="costType">
					<option value="">全部</option>
					<option value="稿费">稿费</option>
					<option value="演播费">演播费</option>
				</select>--%>
				<label for="userCard" class="col-sm-2 control-label">身份证号： </label>
				<input id="userCard" name="userCard" type="text" maxlength="50" style="width: 150px" class="easyui-validatebox"/>
				<input type="hidden" name="detailflag" id="detailflag" value="${detailflag}">
				<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="getexportListsearchdetail();">明细</a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="getexportListsearchtotle();">汇总</a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="getexport();">导出</a>
			</div>
		</div>
	</div>

</div>
<script type="text/javascript">
	var company;
	$(document).ready(function () {
		$.ajax({
			url: "businessOrderController.do?getDeptList",
			type: "GET",
			dataType: "JSON",
			async: false,
			success: function (data) {
				if (data.success) {

					var dept = data.attributes.dept;
					var top;
					if (dept.length > 0) {
						var opt1 = new Option("全部", "");
						document.getElementById('sysOrgCode').options.add(opt1);
						for (var i = 0; i < dept.length; i++) {
							var opt = new Option(dept[i].name, dept[i].code);
							document.getElementById('sysOrgCode').options.add(opt);
							if (i == 0) {
								top = dept[i].code;
							}
						}
					}
					company = data.attributes.comp;
					if (company.length > 0) {
						var opt1 = new Option("全部", "");
						document.getElementById('sysCompanyCode').options.add(opt1);
						for (var i = 0; i < company.length; i++) {
							if (top == company[i].parentCode) {
								var opt = new Option(company[i].name, company[i].code);
								document.getElementById('sysCompanyCode').options.add(opt);
							}
						}
					}
				}
			}
		});
	});
	function changeOrgCode(parentCode) {
		document.getElementById('sysCompanyCode').length = 0;
		var opt1 = new Option("全部", "");
		document.getElementById('sysCompanyCode').options.add(opt1);
		if (company.length > 0) {
			for (var i = 0; i < company.length; i++) {
				if (parentCode == company[i].parentCode) {
					var opt = new Option(company[i].name, company[i].code);
					document.getElementById('sysCompanyCode').options.add(opt);
				}
			}
		}
	}
	function getexportListsearchdetail() {
		$("#detailflag").val("1");
		getexportListsearch();
	}
	function getexportListsearchtotle() {
		$("#detailflag").val("0");
		getexportListsearch();
	}
	function getexport(){
		JeecgExcelExport("businessOrderController.do?topcheckExcel&detailflag="+$("#detailflag").val()+"&startdt=${startdt}&enddt=${enddt}","getexportList");
	}
</script>